import cv2
cap = cv2.VideoCapture(0)
#cap = cv2.VideoCapture('test.mp4')
cap.set(3, 1080) #width
cap.set(4, 2244) #height

while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break
    cv2.imshow('WebCam', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()
